feat(threading): JWZ conversation view#1188
Open
mvanhorn wants to merge 4 commits intofloatpane:masterfrom
Open
feat(threading): JWZ conversation view#1188mvanhorn wants to merge 4 commits intofloatpane:masterfrom
mvanhorn wants to merge 4 commits intofloatpane:masterfrom
Conversation
Adds an internal/threading package implementing the Jamie Zawinski threading algorithm (Message-ID + In-Reply-To + References) with subject-fallback grouping for orphans. The inbox renders one row per thread root with a count and last sender; pressing Enter toggles expand/collapse; the per-folder flat-vs-threaded mode persists via folder_cache. The MessageID/InReplyTo/References metadata is now carried through fetcher and the IMAP/JMAP/POP3 backends, the on-disk email cache, the daemon RPC types, and the inbox model so threading works against cached headers without server round-trips. Per the maintainer's spec in floatpane#509 and floatpane#1130: client-side, provider-agnostic, JWZ rather than X-GM-THRID, deterministic ordering. - internal/threading/jwz.go: ThreadNode, Thread, Build() - internal/threading/subject.go: canonicalSubject() - internal/threading/jwz_test.go: chains, forks, missing parents, subject-fallback grouping, deterministic ordering - tui/inbox.go: threaded mode rendering + 'T' toggle + expand/collapse - config/folder_cache.go: persist threaded toggle per folder - backend/{imap,jmap,pop3}: emit MessageID/InReplyTo/References - screenshots/cmd/threading_demo: VHS helper Closes floatpane#509. Addresses floatpane#1130.
threading_demo.tape captures: flat (5 emails) -> threaded (3 rows with '(3)' count on the root) -> expanded thread (5 rows with indented '↪' markers on the children) -> collapsed -> back to flat. Rendered to public/assets/threading_demo.gif.
- backend/jmap: Email/get now requests inReplyTo and references alongside messageId so JMAP-backed accounts thread by real References/In-Reply-To rather than falling through to subject grouping - internal/threading/subject: add Swedish/Norwegian/Danish (SV), Finnish (VS), Spanish (RV), Portuguese (ENC), Dutch (Antw), Polish (Odp), and Italian (R/I) reply/forward prefixes - internal/threading/jwz_test: regression coverage for SV/RV/Antw subject-fallback grouping
public/assets/threading-remotion-demo.gif shows the flat inbox (5 emails), T toggle to threaded mode (3 rows with the (3) count on the JWZ-grouped root), Enter to expand the thread tree (showing the original + 2 replies indented with ↪ markers). Rendered by Remotion at 1280x720, encoded via --scale=0.6 --every-nth-frame=3.
Member
|
the PR has conflicts with your previous changes in #1186 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
internal/threadingpackage implementing the Jamie Zawinski threading algorithm againstMessage-ID/In-Reply-To/Referencesheaders, with subject-fallback grouping for orphansMessageID,InReplyTo, andReferencesthrough fetcher, the IMAP/JMAP/POP3 backends, the on-disk email cache, the daemon RPC types, and the inbox model so threading works against cached headers without server round-tripsEntertoggles expand/collapse; expanded children render indented with↪markersTkeybind toggles flat vs threaded for the current folder; the per-folder mode persists viafolder_cache.goRe:,Fwd:,Fw:,AW:,WG:,Tr:(lowercased, stripped repeatedly soRe: Re: Foo->foo)Build()callsscreenshots/cmd/threading_demo+screenshots/threading_demo.tape): flat (5 emails) → threaded (3 rows with(3)count on the root) → expanded (5 rows with↪on children) → collapsed → flatSimulated demo (Remotion) — matcha theme, scripted UI, not a live capture.
Why?
This is the maintainer's spec from issue #509 and the more detailed #1130:
The framing in #1130 is the user-visible argument: "Showing each reply as a separate inbox row is how Mutt looked in 1999. Modern terminal clients (aerc, himalaya) all thread."
The launch threads on r/coolgithubprojects + r/CLI + r/selfhosted (cumulative 161 upvotes, 32 comments) consistently flagged conversation grouping as the gap users notice first when comparing matcha to gmail/superhuman/aerc.
Notes
main.go(alongside in-flight chore: refactor main.go #845 and feat: offline mode initial commit #686). Conflicts should be mechanical - the threading wiring inmain.gois small (cache-conversion paths to carry References/InReplyTo). Happy to rebase or stack PRs.EmailIDsoBuild()is deterministic across runs.X-GM-THRIDand IMAP THREAD (RFC 5256) per the spec - threading is purely client-side over cached envelope data.Closes #509. Addresses #1130.
This contribution was developed with AI assistance.